From: Carlos Garnacho Date: Mon, 26 May 2025 15:23:30 +0000 (+0200) Subject: windowMenu: Use Clutter.Sprite for finding the pointer focus X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~104^2^2~26 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=12aa003a3c29fe3881def76e069cf945c215f0c3;p=gnome-shell.git windowMenu: Use Clutter.Sprite for finding the pointer focus Update to API updates in Mutter, by looking up the sprite and using it in window drag API. Part-of: --- diff --git a/js/ui/windowMenu.js b/js/ui/windowMenu.js index f30317d9a..c140dee4d 100644 --- a/js/ui/windowMenu.js +++ b/js/ui/windowMenu.js @@ -1,4 +1,3 @@ -import Clutter from 'gi://Clutter'; import Meta from 'gi://Meta'; import St from 'gi://St'; @@ -56,19 +55,13 @@ export class WindowMenu extends PopupMenu.PopupMenu { item.setSensitive(false); item = this.addAction(_('Move'), event => { - const device = event.get_device(); - const seat = device.get_seat(); - const deviceType = device.get_device_type(); - const pointer = - deviceType === Clutter.InputDeviceType.POINTER_DEVICE || - deviceType === Clutter.InputDeviceType.TABLET_DEVICE || - deviceType === Clutter.InputDeviceType.PEN_DEVICE || - deviceType === Clutter.InputDeviceType.ERASER_DEVICE - ? device : seat.get_pointer(); + const backend = global.stage.get_context().get_backend(); + const sprite = backend.get_sprite(global.stage, event) || + backend.get_pointer_sprite(global.stage); window.begin_grab_op( Meta.GrabOp.KEYBOARD_MOVING, - pointer, null, + sprite, event.get_time(), null); }); @@ -76,19 +69,13 @@ export class WindowMenu extends PopupMenu.PopupMenu { item.setSensitive(false); item = this.addAction(_('Resize'), event => { - const device = event.get_device(); - const seat = device.get_seat(); - const deviceType = device.get_device_type(); - const pointer = - deviceType === Clutter.InputDeviceType.POINTER_DEVICE || - deviceType === Clutter.InputDeviceType.TABLET_DEVICE || - deviceType === Clutter.InputDeviceType.PEN_DEVICE || - deviceType === Clutter.InputDeviceType.ERASER_DEVICE - ? device : seat.get_pointer(); + const backend = global.stage.get_context().get_backend(); + const sprite = backend.get_sprite(global.stage, event) || + backend.get_pointer_sprite(global.stage); window.begin_grab_op( Meta.GrabOp.KEYBOARD_RESIZING_UNKNOWN, - pointer, null, + sprite, event.get_time(), null); });